import axiosService from '../http/axiosService.js'

export const login = (userName, password) => {
  return axiosService({
    url: '/backend/login',
    method: 'post',
    data: {
      user_name: userName,
      password
    }
  })
}

export const doAddUser = (userName, password, roleId) => {
  return axiosService({
    url: '/backend/newUser',
    method: 'post',
    data: {
      user_name: userName,
      password,
      // user_status: userStatus,
      role_id: roleId
    }
  })
}

export const doEditUser = (id, userName, password, roleId, userStatus) => {
  return axiosService({
    url: '/backend/editUser',
    method: 'post',
    data: {
      backend_user_id: id,
      user_name: userName,
      password,
      user_status: userStatus,
      role_id: roleId
    }
  })
}
export const doChangePassword = (id, password) => {
  return axiosService({
    url: '/backend/resetPassword',
    method: 'post',
    data: {
      backend_user_id: id,
      password
    }
  })
}

export const getUserList = (pageNo, pageSize) => {
  return axiosService({
    url: '/backend/userList',
    method: 'post',
    data: {
      page_no: pageNo,
      page_size: pageSize
    }
  })
}
